package game.util;

import java.util.Random;

public class RandomUtil {

    private static Random random = new Random();

    /**
     * 计算是否命中
     *
     * @param percent
     * @return
     */
    public static boolean shotOn(int percent) {

        int i = random.nextInt(101);
        if (i <= percent) {
            return true;
        } else {
            return false;
        }
    }

    public static int randomInt() {
        return random.nextInt(9999);
    }
}
